package com.itheima.springboottilasmanager.controller;

import com.itheima.springboottilasmanager.pojo.dto.GenderCount;
import com.itheima.springboottilasmanager.pojo.vo.JobVO;
import com.itheima.springboottilasmanager.pojo.vo.StudentVO;
import com.itheima.springboottilasmanager.pojo.domain.Result;
import com.itheima.springboottilasmanager.survice.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    /*
    * 职位统计
    * */
    @Autowired
    ReportService reps;
    @GetMapping("/empJobData")
    public Result empJobReport() {
//        1.
        log.info("职位统计");
        JobVO j1 = reps.empJobReport();
        return Result.success(j1);
    }
    @GetMapping("/empGenderData")
    public Result empGenderReport() {
//        1.接收参数，没有则不用
        log.info("性别统计");
//
        List<GenderCount> list = reps.empGenderReport();

      return Result.success(list);
    }
    @GetMapping("/studentDegreeData")
    public Result studentDegreeReport() {
//        1.接收参数，没有则不用
        log.info("学历统计");
//
        List<GenderCount> list = reps.studentDegreeReport();
      return Result.success(list);
    }
    @GetMapping("/studentCountData")
    public Result studentCountReport(){
        StudentVO V2 = reps.studentCountReport();

        return  Result.success(V2);
    }
}
